#ifndef GRAPHTESTSUITE_HPP
#define GRAPHTESTSUITE_HPP

#include "Graph.hpp"
#include <cpptest.h>
#include <iostream>

class GraphTestSuite : public Test::Suite
{
public:
  GraphTestSuite()
  {
    TEST_ADD(GraphTestSuite::nodeDegreeTest);
    TEST_ADD(GraphTestSuite::edgeAddTwiceTest);
  }

private:
  void nodeDegreeTest()
  {
    Graph graph;
    Node node1;
    Node node2;
    Edge edge(node1, node2);

    // this should go ok
    TEST_ASSERT(graph.addEdge(edge, true) == true);

    TEST_ASSERT(node1.getDegree() == 1);
    TEST_ASSERT(node1.getOutDegree() == 1);
    TEST_ASSERT(node1.getInDegree() == 0);
  }

  void edgeAddTwiceTest()
  {
    Graph graph;
    Node node1;
    Node node2;
    Edge edge(node1, node2);
    Edge edge2(node1, node2);

    // this should go ok
    TEST_ASSERT(graph.addEdge(edge, true) == true);
    // this should return false since we've already added the edge to
    // the graph
    TEST_ASSERT(graph.addEdge(edge, true) == false);
    // this should return false since we already added the nodes, but
    // it will still add the edge to the graph
    TEST_ASSERT(graph.addEdge(edge2, true) == false);

    TEST_ASSERT(node1.getDegree() == 2);
  }
};

#endif
